package homowork0720;
import java.util.Arrays;
import java.util.Properties;

public class SubZifu {
    public static void main(String[] args) {
        String url = "http://www.lovo.com/index?name=aaaaaa&age=20&gender=男";
        String info = null;
        Properties properties = new Properties();
        UntilProperties untilProperties = new UntilProperties();
        for (int i = 0; i < url.length(); i++) {
            if (url.charAt(i) == '?') {
                info = url.substring((i + 1), url.length());
                break;
            }
        }
        String[] infoArray = info.split("&");
        System.out.println(Arrays.toString(infoArray));
        for (int i = 0; i < infoArray.length; i++) {
            String[] keyAndValue = infoArray[i].split("=");
            properties.setProperty(keyAndValue[0], keyAndValue[1]);
        }
        untilProperties.PropertyOutputStream(properties,"zuoye.properties");
    }
}
